package com.liaozibo.demo.seckill.support.export.impl;

import com.liaozibo.demo.seckill.support.common.exception.BizException;
import com.liaozibo.demo.seckill.support.export.dto.OrderDTO;
import com.liaozibo.demo.seckill.support.export.dto.Result;
import com.liaozibo.demo.seckill.support.export.service.SettlementExportService;
import com.liaozibo.demo.seckill.support.service.SettlementService;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

@DubboService
public class SettlementExportServiceImpl implements SettlementExportService {

    @Autowired
    private SettlementService settlementService;

    @Override
    public Result submitOrder(OrderDTO orderDTO) {
        try {
            settlementService.submitOrder(orderDTO);
            return Result.ok();
        } catch (BizException e) {
            return Result.fail();
        }
    }
}
